
package org.come.Jpanel;

import java.awt.*;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.lang.ref.SoftReference;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import com.tool.image.ImageMixDeal;
import com.tool.tcp.*;
import com.tool.tcp.Frame;
import org.come.bean.*;
import org.come.entity.Goodstable;
import org.come.entity.RoleSummoning;
import org.come.model.Configure;
import org.come.model.Eshop;
import org.come.model.Shop;
import org.come.model.petExchange;
import org.come.starcard.JpanelStarCardMain;
import org.come.summonequip.JframeSummonEquipMain;
import org.come.summonequip.JpanelSummonEquipMain;
import org.come.until.*;
import org.wing.panel.WingMainFrame;
import org.wing.panel.WingMainPanel;
import com.gl.util.Xy2Util;
import com.tool.btn.BaptizeBtn;
import com.tool.role.RoleProperty;
import com.tool.tcpimg.ChatBox;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;

//TODO 道具展示面板，文字描述
public class GoodsMsgJpanel extends JPanel {

    ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
    Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
    private int gwidth;// 面板的宽度
    private int gheight;// 面板的高度
    private JLabel labgoodsimg;// 物品的图像
    private JLabel sbjljd;
    private NewPart part;
    public GoodsMsgJpanel(int gwidth, int gheight) {
        // 键盘监听
        this.gwidth = gwidth;
        this.gheight = gheight;

        this.setPreferredSize(new Dimension(gwidth, gheight));
        this.setLayout(null);
        this.setBackground(new Color(0, 0, 0, 0));

        labgoodsimg = new JLabel();
        labgoodsimg.setBounds(15, 15, 120, 120);
        this.add(labgoodsimg);

        box = new ChatBox();
    }
    private ChatBox box;//展示数据
    private boolean jy = false;
    private int lock = 0;
    private int goodTimeLock;
    //物品是否有时间锁
    private Long goodTimeLockDuration;
    private long type = 0;   //物品类型
    private long code = 0;	//物品编号

    private ImageIcon daoju = new ImageIcon("inkImg/old/1/137.png");
    private ImageIcon yaopin = new ImageIcon("inkImg/old/1/138.png");
    private ImageIcon putongzhuangbei = new ImageIcon("inkImg/old/1/139.png");
    private ImageIcon cailiao = new ImageIcon("inkImg/old/1/141.png");
    private ImageIcon kuangshi = new ImageIcon("inkImg/old/1/142.png");
    private ImageIcon CWzhuangbei = new ImageIcon("inkImg/old/1/146.png");
    private ImageIcon hushenfu = new ImageIcon("inkImg/old/1/143.png");
    private ImageIcon huoban = new ImageIcon("inkImg/old/1/147.png");
    private ImageIcon peishi = new ImageIcon("inkImg/old/1/140.png");
    private ImageIcon xianqi = new ImageIcon("inkImg/old/1/7.png");
    private ImageIcon shenbing = new ImageIcon("inkImg/old/1/5.png");
    private ImageIcon Ding = new ImageIcon("inkImg/hongmu/1/bukejiaoyi.png");
    private ImageIcon Dingzhi = new ImageIcon("inkImg/hongmu/1/bukexilian.png");
    private ImageIcon shenqi= new ImageIcon("inkImg/hongmu/1/dingzhishenqi.png");
    private ImageIcon jyimg = new ImageIcon("inkImg/old/1/禁交易.png");
    private ImageIcon jyimg1 = new ImageIcon("inkImg/old/1/可交易.png");
    private ImageIcon icon = new ImageIcon("inkImg/hongmu/2/goodorpet_lock.png");
    private ImageIcon shanggu =new ImageIcon("inkImg/hongmu/1/shenqi.png");
    private ImgZoom imgZoom = CutButtonImage.cuts("inkImg/old/1/Z1007.png", 14, 7, true);

    // 使用SoftReference包装静态Sprite对象，允许JVM在内存不足时回收
    private static SoftReference<Sprite> tcpRef = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/兜率.tcp", null));
    private static SoftReference<Sprite> tcp1Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/皇道.tcp", null));
    private static SoftReference<Sprite> tcp2Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/神木.tcp", null));
    private static SoftReference<Sprite> tcp3Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/文殊.tcp", null));
    private static SoftReference<Sprite> tcp4Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/紫霄.tcp", null));
    private static SoftReference<Sprite> tcp5Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/皇1道.tcp", null));
    private static SoftReference<Sprite> tcp6Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/逐日.tcp", null));
    private static SoftReference<Sprite> tcp7Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/星宿.tcp", null));
    private static SoftReference<Sprite> tcp8Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/地藏.tcp", null));
    private static SoftReference<Sprite> tcp9Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/北冥.tcp", null));
    private static SoftReference<Sprite> tcp10Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/伏羲.tcp", null));
    private static SoftReference<Sprite> tcp11Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/火.tcp", null));
    private static SoftReference<Sprite> tcp12Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/镜子.tcp", null));
    private static SoftReference<Sprite> tcp13Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/mouse/特效/太阴.tcp", null));
    private static SoftReference<Sprite> tcp14Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/NewRoleUi/36角色/最新特效/14.tcp", null));
    private static SoftReference<Sprite> tcp15Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/NewRoleUi/36角色/最新特效/15.tcp", null));
    private static SoftReference<Sprite> tcp16Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/NewRoleUi/36角色/最新特效/19.tcp", null));
    private static SoftReference<Sprite> tcp17Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/NewRoleUi/36角色/最新特效/7.tcp", null));
    private static SoftReference<Sprite> tcp18Ref = new SoftReference<>(SpriteFactory.VloadSprite("resource/NewRoleUi/36角色/最新特效/17.tcp", null));

    // 添加获取Sprite的方法，如果被回收则重新加载
    private static Sprite getSprite(SoftReference<Sprite> ref, String path) {
        Sprite sprite = ref.get();
        if (sprite == null) {
            sprite = SpriteFactory.VloadSprite(path, null);
            if (path.equals("resource/mouse/特效/兜率.tcp")) {
                tcpRef = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/皇道.tcp")) {
                tcp1Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/神木.tcp")) {
                tcp2Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/文殊.tcp")) {
                tcp3Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/紫霄.tcp")) {
                tcp4Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/皇1道.tcp")) {
                tcp5Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/逐日.tcp")) {
                tcp6Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/星宿.tcp")) {
                tcp7Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/地藏.tcp")) {
                tcp8Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/北冥.tcp")) {
                tcp9Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/伏羲.tcp")) {
                tcp10Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/火.tcp")) {
                tcp11Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/镜子.tcp")) {
                tcp12Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/mouse/特效/太阴.tcp")) {
                tcp13Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/NewRoleUi/36角色/最新特效/14.tcp")) {
                tcp14Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/NewRoleUi/36角色/最新特效/15.tcp")) {
                tcp15Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/NewRoleUi/36角色/最新特效/19.tcp")) {
                tcp16Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/NewRoleUi/36角色/最新特效/7.tcp")) {
                tcp17Ref = new SoftReference<>(sprite);
            } else if (path.equals("resource/NewRoleUi/36角色/最新特效/17.tcp")) {
                tcp18Ref = new SoftReference<>(sprite);
            }
        }
        return sprite;
    }

    Configure configure9;
    Graphics g22;

    @Override
    public void paint(Graphics g) {
        configure9 = item.get(new BigDecimal(9));
        //装备背景特效开关（!configure加感叹号是反义）
        if(!configure9.getZqjnsx().equals("关")){
            getSprite(tcpRef, "resource/mouse/特效/兜率.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp1Ref, "resource/mouse/特效/皇道.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp2Ref, "resource/mouse/特效/神木.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp3Ref, "resource/mouse/特效/文殊.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp4Ref, "resource/mouse/特效/紫霄.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp5Ref, "resource/mouse/特效/皇1道.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp6Ref, "resource/mouse/特效/逐日.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp7Ref, "resource/mouse/特效/星宿.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp8Ref, "resource/mouse/特效/地藏.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp9Ref, "resource/mouse/特效/北冥.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp12Ref, "resource/mouse/特效/镜子.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp13Ref, "resource/mouse/特效/太阴.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp14Ref, "resource/NewRoleUi/36角色/最新特效/14.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp15Ref, "resource/NewRoleUi/36角色/最新特效/15.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp16Ref, "resource/NewRoleUi/36角色/最新特效/19.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
            getSprite(tcp18Ref, "resource/NewRoleUi/36角色/最新特效/17.tcp").updateToTime(ImageMixDeal.userimg.getTime(), 0);
        }
        imgZoom.draw(g);
        g22 = g.create(135, 5, 310, gheight - 10);
        box.paint(g22);
        g22.dispose();
        if (jy){
            g.drawImage(jyimg.getImage(), gwidth - 100, gheight -80 , jyimg.getIconWidth(), jyimg.getIconHeight(), this);
        } else {

            g.drawImage(jyimg1.getImage(), gwidth - 100, gheight -80 , jyimg1.getIconWidth(), jyimg1.getIconHeight(), this);
        }
        // 神兵
        if (type == 6500 || type == 6900 || type == 6601 || type == 6600
                || type == 6701 || type == 6700 || type == 6900 || type == 6800) {
            //g.drawImage(shenbing.getImage(), 10, 10, shenbing.getIconWidth(), shenbing.getIconHeight(), this);
            if (code != 0) {
//				g.setColor(UIUtils.COLOR_YCode);
//				g.drawString("╔ ═ ═ ═ ═ ╗", 10, gheight - 100);
//				g.drawString("║", 10, gheight - 90);
//				g.drawString("║", 10, gheight - 70);
//				g.drawString("║", 10, gheight - 50);
//				g.drawString("║", 10, gheight - 30);
//				g.drawString("║", 85, gheight - 90);
//				g.drawString("║", 85, gheight - 70);
//				g.drawString("║", 85, gheight - 50);
//				g.drawString("║", 85, gheight - 30);
//				g.drawString("╚ ═ ═ ═ ═ ╝", 10, gheight - 20);
//				g.setColor(UIUtils.COLOR_RCode);
//				g.drawString("公", 30, gheight - 88);
//				g.drawString("益", 30, gheight - 68);
//				g.drawString("西", 30, gheight - 49);
//				g.drawString("游", 30, gheight - 30);
//				g.setColor(UIUtils.COLOR_BCode);
//				g.drawString("专", 60, gheight - 88);
//				g.drawString("属", 60, gheight - 68);
//				g.drawString("订", 60, gheight - 49);
//				g.drawString("制", 60, gheight - 30);
                g.setColor(UIUtils.COLOR_SBCode);
                g.drawString("编号  "+"8888"+"@"+code/1000, 140, gheight - 7);
                g.drawString("神兵类", 10, gheight - 7);

                g.drawImage(shenbing.getImage(), 5, 5, shenbing.getIconWidth(), shenbing.getIconHeight(), this);
            }
        }
        // 仙器
        if (type >= 7000 && type <= 7004) {
            //g.drawImage(xianqi.getImage(), 10, 10, xianqi.getIconWidth(), xianqi.getIconHeight(), this);
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_Wing1);
                g.drawString("编号  "+"8888"+"@"+code/1000, 140, gheight - 7);
//				g.drawString("归属者", 10, gheight - 22);
                g.drawString("仙器类", 10, gheight - 7);
                g.drawImage(xianqi.getImage(), 5, 5, xianqi.getIconWidth(), xianqi.getIconHeight(), this);
            }
        }
        final Goodstable good = this.goodsss;
        if (good != null && good.getValue() != null) {
            final String[] vcs = good.getValue().split("\\|");
            int i = 0;
            while (i < vcs.length) {
                final String[] zhi = vcs[i].split("=");
                if (zhi[0].equals("制作人")) {
                    g.setFont(new Font("宋体", 0, 13));
                    g.setColor(Color.decode("#ce43d32"));
                    g.drawString("制作人 " + this.zhizuo, 10, 140);
                }
                ++i;
            }
        }
        if (type >= 8868&& type <= 8872) {//判断是否定制类型
            g.drawImage(Ding.getImage(), 15, 130, Ding.getIconWidth(), Ding.getIconHeight(), this);
            g.drawImage(shenqi.getImage(), 5, 5, shenqi.getIconWidth(), shenqi.getIconHeight(), this);
            g.drawImage(Dingzhi.getImage(), 15, 160, Dingzhi.getIconWidth(), Dingzhi.getIconHeight(), this);
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_Wing1);
                g.drawString("编号  "+"8888"+"@"+code/1000, 140, gheight - 7);
            }
        }
        // 配饰
        if (type == 927 || type == 928 || type == 929 || type == 930|| type == 931
                || type == 606 || type == 607 || type == 608 || type == 609|| type == 610) {
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_SBCode);
                g.drawImage(peishi.getImage(), 5, 5, peishi.getIconWidth(), peishi.getIconHeight(), this);
            }
        }
        // 伙伴装备
        if (type >= 7500&& type <= 7511) {
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_SBCode);
                g.drawImage(huoban.getImage(), 5, 5, huoban.getIconWidth(), huoban.getIconHeight(), this);
            }
        }
        // 护身符
        if (type == 611|| type == 612) {
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_SBCode);
                g.drawImage(hushenfu.getImage(), 5, 5, hushenfu.getIconWidth(), hushenfu.getIconHeight(), this);
            }
        }

        // 道具
        if (type > 1 && type < 119 || type > 119 && type < 301 || type >= 302 && type < 497 || type >= 501 && type <= 504 || type == 506 || type > 507 && type <= 509 || type > 515 && type <= 520 || type > 525 && type <= 599 || type >= 712 && type <= 743 || type >= 745 && type <= 799 || type >= 801 && type <= 6499 || type >= 7005 && type <= 7511 || type == 60001 || type == 60002 ) {
            g.drawImage(daoju.getImage(), 5, 5, daoju.getIconWidth(), daoju.getIconHeight(), this);
        }
        // 矿石
        if (type == 500 ) {
            g.drawImage(kuangshi.getImage(), 5, 5, kuangshi.getIconWidth(), kuangshi.getIconHeight(), this);
        }
        // 药品
        if (type == 0 ) {
            g.drawImage(yaopin.getImage(), 5, 5, yaopin.getIconWidth(), yaopin.getIconHeight(), this);
        }
        // 普通装备
        if (type >= 600 && type <= 605 || type == 800 ) {
            g.setColor(UIUtils.COLOR_NAME6);
            g.setFont(UIUtils.TEXT_FONTZSF20);
            g.drawString("大话西游Ⅱ经典版 $Revision: 2309011-", 10, gheight - 7);
            g.drawImage(putongzhuangbei.getImage(), 5, 5, putongzhuangbei.getIconWidth(), putongzhuangbei.getIconHeight(), this);
        }
        // 宠物装备
        if (type >= 510 && type <= 512 ) {
            g.drawImage(CWzhuangbei.getImage(), 5, 5, CWzhuangbei.getIconWidth(), CWzhuangbei.getIconHeight(), this);
        }
        // 材料
        if (type >= 702 && type <= 711 || type >= 497 && type < 500 || type == 505 || type == 507 || type == 744 || type >= 8889 && type <= 8893 || type >= 513 && type <= 515 || type >= 521 && type <= 524 || type == 119 ) {
            g.drawImage(cailiao.getImage(), 5, 5, cailiao.getIconWidth(), cailiao.getIconHeight(), this);
        }

        if (type==7000){//衣服
            getSprite(tcp15Ref, "resource/NewRoleUi/36角色/最新特效/15.tcp").draw(g,70,75);
        }
        if (type==7001){//衣服
            getSprite(tcp15Ref, "resource/NewRoleUi/36角色/最新特效/15.tcp").draw(g,70,75);
        }
        if (type==7003){//鞋子
            getSprite(tcp15Ref, "resource/NewRoleUi/36角色/最新特效/15.tcp").draw(g,70,75);
        }
        if (type==7002){//项链
            getSprite(tcp15Ref, "resource/NewRoleUi/36角色/最新特效/15.tcp").draw(g,70,75);
        }
        if (type==7004){//武器
            getSprite(tcp14Ref, "resource/NewRoleUi/36角色/最新特效/14.tcp").draw(g,70,75);
            getSprite(tcp4Ref, "resource/mouse/特效/紫霄.tcp").draw(g,70,75);
        }
        if (type==6500){//神兵武器
            getSprite(tcp14Ref, "resource/NewRoleUi/36角色/最新特效/14.tcp").draw(g,70,75);
            getSprite(tcp4Ref, "resource/mouse/特效/紫霄.tcp").draw(g,70,75);
        }
        if (type==6601){//神兵男帽子
            getSprite(tcp7Ref, "resource/mouse/特效/星宿.tcp").draw(g,70,75);
        }
        if (type==6600){//神兵女帽子
            getSprite(tcp7Ref, "resource/mouse/特效/星宿.tcp").draw(g,70,75);
        }
        if (type==6800){//神兵项链
            getSprite(tcp7Ref, "resource/mouse/特效/星宿.tcp").draw(g,70,75);
        }
        if (type==6900){//神兵鞋子
            getSprite(tcp7Ref, "resource/mouse/特效/星宿.tcp").draw(g,70,75);
        }
        if(Goodtype.GodEquipment_God(type) || Goodtype.GodEquipment_xian(type)) {
            if (this.part!=null) {
                this.part.draw(g, 80, gheight-40, 0, ImageMixDeal.userimg.getTime(), (float)timestampToCircularValue());
            }
        }
        if(type == 60007) {
            if (this.part!=null) {
                this.part.draw(g, gwidth/4, 150, 0, ImageMixDeal.userimg.getTime(), (float)timestampToCircularValue());
            }
        }
        //所有配饰的表
        if (type==606){//翠玉扳指
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").draw(g,70,75);
        }
        if (type==607){//伽蓝碎雨
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").draw(g,70,75);
        }
        if (type==608){//祥云流带
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").draw(g,70,75);
        }
        if (type==609){//半面妆
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").draw(g,70,75);
        }
        if (type==610){//披风
            getSprite(tcp17Ref, "resource/NewRoleUi/36角色/最新特效/7.tcp").draw(g,70,75);
        }
        if (type==611){//护身符
            getSprite(tcp16Ref, "resource/NewRoleUi/36角色/最新特效/19.tcp").draw(g,70,75);
        }
        if (type==612){//护身符
            getSprite(tcp16Ref, "resource/NewRoleUi/36角色/最新特效/19.tcp").draw(g,70,75);
        }
        if (lock == 1){
            g.drawImage(icon.getImage(), 5, 5, 10, 12, this);
        }
        if (type==929) {//祥云流带
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").draw(g, 70, 75);
            //getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").draw(g,20,150);
            g.setFont(UIUtils.TEXT_FONT);
            g.setColor(UIUtils.COLOR_Wing1);
            g.drawString("神饰类:琉璃", 10, gheight - 7);
            g.drawImage(shanggu.getImage(),315,gheight - 45,86,42,this);
        }
        if (type==928) {//翠玉扳指
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").draw(g, 70, 75);
            //getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").draw(g,20,150);
            g.setFont(UIUtils.TEXT_FONT);
            g.setColor(UIUtils.COLOR_Wing1);
            g.drawString("神饰类:琉璃", 35, gheight - 7);
            g.drawImage(shanggu.getImage(),315,gheight - 45,86,42,this);
        }
        if (type==931) {//伽蓝碎雨
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").draw(g, 70, 75);
            //getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").draw(g,20,150);
            g.setFont(UIUtils.TEXT_FONT);
            g.setColor(UIUtils.COLOR_Wing1);
            g.drawString("神饰类:琉璃", 10, gheight - 7);
            g.drawImage(shanggu.getImage(),315,gheight - 45,86,42,this);
            if (code != 0) {
                g.setFont(UIUtils.TEXT_FONT);
                g.setColor(UIUtils.COLOR_SBCode);
                g.drawString("编号  "+"2895"+"@"+code/1000, 140, gheight - 7);
            }
        }
        if (type==927) {//琅邪梦断
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").draw(g, 70, 75);
            //getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").draw(g,20,150);
            g.setFont(UIUtils.TEXT_FONT);
            g.setColor(UIUtils.COLOR_Wing1);
            g.drawString("神饰类:琉璃", 35, gheight - 7);
            g.drawImage(shanggu.getImage(),315,gheight - 45,86,42,this);
        }
        if (type==930) {//流火披风
            getSprite(tcp10Ref, "resource/mouse/特效/伏羲.tcp").draw(g, 70, 75);
            //getSprite(tcp11Ref, "resource/mouse/特效/火.tcp").draw(g,20,150);
            g.setFont(UIUtils.TEXT_FONT);
            g.setColor(UIUtils.COLOR_Wing1);
            g.drawString("神饰类:琉璃", 35, gheight - 7);
            g.drawImage(shanggu.getImage(),315,gheight - 45,86,42,this);
        }
        if (type == 923) {//星辰之光
            getSprite(tcp14Ref, "resource/NewRoleUi/36角色/最新特效/14.tcp").draw(g, 60, 140);
        }
        super.paint(g);

    }
    /**颜色替换*/
    public String upColor(StringBuffer buffer,String color1,String color2){
        if (color1==null||!color2.equals(color1)) {
            buffer.append(color2);
            return color2;
        }else {
            return color1;
        }
    }
    /**炼化属性展示处理*/
    public String showEw0(StringBuffer buffer,String value,long type) {
        String xz=null;
        String color=null;
        boolean is=Goodtype.GodEquipment_God(type)||Goodtype.GodEquipment_xian(type)||Goodtype.GodEquipment_Ding(type);
        Map<String, String> mapattribute = new HashMap<>();
        String[] v = value.split("&");
        for (int i = 1; i < v.length; i++) {
            String[] vs = v[i].split("=");
            if (mapattribute.containsKey(vs[0])){
                mapattribute.put(vs[0] , addValues(mapattribute.get(vs[0]), vs[1]));
            }else{
                mapattribute.put(vs[0] , vs[1]);
            }
            if (v[i].startsWith("星阵属性")) {
                xz = v[i];
                continue;
            }
            if (buffer.length() != 0) {
                buffer.append("#r");
            }
            if (vs[0].equals("特技")) {
                color = upColor(buffer, color, "#ca098c8");
                buffer.append("特技");
                for (int j = 1; j < vs.length; j++) {
                    Skill skill = UserMessUntil.getSkillId(vs[j]);
                    if (skill != null) {
                        if (buffer.length() != 0) {
                            buffer.append("#r");
                        }
                        buffer.append(skill.getSkillname());
                        buffer.append(":");
                        buffer.append(skill.getRemark());
                    }
                }
            } else if (vs[0].endsWith("等级")) {
                color = upColor(buffer, color, "#c00ff00");
                buffer.append(vs[0]);
                buffer.append(" ");
                buffer.append(vs[1]);
                buffer.append("级");
            } else if (vs[0].equals("资质")) {
                color = upColor(buffer, color, "#cFFFFFF");
                buffer.append("【神通】");
                buffer.append(vs[0]);
                buffer.append(" ");
                buffer.append(vs[1]);
                buffer.append("/100");
//            } else {
//                color=upColor(buffer, color, is?"#c00EAFF":"#c00ff00");
//                buffer.append(vs[0]);
//                buffer.append(" ");
//                buffer.append(zffh(vs[1]));
//                buffer.append(tianjia(vs[0]));
            }
        }
        for (Map.Entry<String, String> entry : mapattribute.entrySet()) {
            String attributeName = entry.getKey();
            String attributeValue = entry.getValue();
            if ("特技".equals(attributeName)){
                continue;
            }
            if (buffer.length() != 0) {
                buffer.append("#r");
            }
            color = upColor(buffer, color, is ? "#c00EAFF" : "#c00ff00");
            buffer.append(attributeName);
            buffer.append(" ");
            buffer.append(zffh(attributeValue));
            buffer.append(tianjia(attributeName));
        }
        return xz;
    }

    private String addValues(String oldValue , String newValue){
        try{
            double value1 = Double.parseDouble(oldValue);
            double value2 = Double.parseDouble(newValue);
            double value3 = value1 + value2;
            return String.valueOf(value3);
        } catch (NumberFormatException e){
            return oldValue + "+" + newValue;
        }
    }
    public void showEw8(StringBuffer buffer,String value,long type){
        String xz=null;
        String color=null;
        boolean is=Goodtype.GodEquipment_God(type)||Goodtype.GodEquipment_xian(type);
        String[] v = value.split("&");
        for (int i = 1; i < v.length; i++) {
            if (v[i].startsWith("星阵属性")) {xz=v[i];continue;}
            String[] vs = v[i].split("=");
            if (buffer.length()!=0) {buffer.append("#r");}
            if (vs[0].equals("特技")) {
                color=upColor(buffer, color, "#ca098c8");
                buffer.append("特技");
                for (int j = 1; j < vs.length; j++) {
                    Skill skill = UserMessUntil.getSkillId(vs[j]);
                    if (skill != null) {
                        if (buffer.length()!=0) {buffer.append("#r");}
                        buffer.append(skill.getSkillname());
                        buffer.append(":");
                        buffer.append(skill.getRemark());
                    }
                }
            } else if (vs[0].endsWith("等级")) {
                color=upColor(buffer, color, "#c00ff00");
                buffer.append(vs[0]);
                buffer.append(" ");
                buffer.append(vs[1]);
                buffer.append("级");
            } else if (vs[0].equals("资质")) {
                color=upColor(buffer, color, "#cFFFFFF");
                buffer.append("【神通】");
                buffer.append(vs[0]);
                buffer.append(" ");
                buffer.append(vs[1]);
                buffer.append("/100");
            } else {
                color=upColor(buffer, color, is?"#c00EAFF":"#cCFB53B");
                buffer.append(vs[0]);
                buffer.append(" ");
                if (vs[0].equals("总点翠值")){
                    buffer.append(zffh1(vs[1]));
                }else {
                    buffer.append(zffh(vs[1]));
                    buffer.append(tianjia(vs[0]));
                }


            }
        }
    }
    public static String zffh1(String v) {
        StringBuffer buffer = new StringBuffer();
        try {
            double z = Double.parseDouble(v);
            if (z > 0)
                buffer.append(":");//装备属性加号
            String[] vs = v.split("\\.");
            buffer.append(vs[0]);
            if (vs.length >= 2) {
                buffer.append(".");
                buffer.append(vs[1].charAt(0));
            }
            return buffer.toString();
        } catch (Exception e) {
        }
        return v;
    }
    public void showEw10(StringBuffer buffer, String value,String fysh){
        String yishname = "";
        if(fysh!=null) {
            petExchange pet = Util.getPetfoid(fysh);
            if(pet!=null) {
                yishname = pet.getName();
            }
            this.part = getPartSH(pet.getSkin());
            String[] v = value.split("&");
            if(buffer.length()!=0){buffer.append("#r");}
            String color = upColor(buffer, null, "#cFFB5C5");
            buffer.append("封印");
            buffer.append("【"+yishname+"】");
            for (int i = 1; i < v.length; i++) {
                String[] vs = v[i].split("=");
                if(buffer.length()!=0){buffer.append("#r");}
                color = upColor(buffer, color, "#cFFB5C5");
                buffer.append(vs[0]);
                buffer.append(" ");
                if(vs.length>1) {
                    buffer.append(zffh(vs[1]));
                }
                buffer.append(tianjia(vs[0]));
            }
        }
    }
    public void showEw100(StringBuffer buffer, String value,String fysh,int s){
        if(fysh!=null) {
            petExchange pet = Util.getPetfoid(fysh);
            String[] v = value.split("&");
            if(buffer.length()!=0){buffer.append("#r");}
            String color = upColor(buffer, null, "#c00EAFF");
            buffer.append("已附灵次数：");
            buffer.append("【"+s+"】");
            this.part = getPartSH(pet.getSkin());
            for (int i = 1; i < v.length; i++) {
                String[] vs = v[i].split("=");
                if(buffer.length()!=0){buffer.append("#r");}
                color = upColor(buffer, color, "#cFFB5C5");
                buffer.append(vs[0]);
                buffer.append(" ");
                if(vs.length>1) {
                    buffer.append(zffh(vs[1]));
                }
                buffer.append(tianjia(vs[0]));
            }
        }
    }
    /**炼器属性*/
    public void showEw1(StringBuffer buffer, String value) {
        Map<String, String> mapattribute = new HashMap<>();
        String[] v = value.split("&");
        if (buffer.length() != 0) {
            buffer.append("#r");
        }
        String color = upColor(buffer, null, "#W");
        buffer.append("【炼器】");
        color = upColor(buffer, color, "#c00EAFF");
        buffer.append("开光次数 ");
        buffer.append(v[1]);
        for (int i = 2; i < v.length; i++) {
            String[] vs = v[i].split("=");
            if (mapattribute.containsKey(vs[0])) {
                mapattribute.put(vs[0], addValues(mapattribute.get(vs[0]), vs[1]));
            } else {
                mapattribute.put(vs[0], vs[1]);
            }
        }
        for (Map.Entry<String, String> entry : mapattribute.entrySet()) {
            String attributeName = entry.getKey();
            String attributeValue = entry.getValue();
            if (buffer.length() != 0) {
                buffer.append("#r");
            }
            color = upColor(buffer, color, "#c00ff00");
            buffer.append(attributeName);
            buffer.append(" ");
            buffer.append(zffh(attributeValue));
            buffer.append(tianjia(attributeName));
        }
    }
    /**神兵属性*/
    public void showEw2(StringBuffer buffer, String value){
        String color = null;
        String[] v = value.split("&");
        for (int i = 1; i < v.length; i++) {
            String[] vs = v[i].split("=");
            if(buffer.length()!=0){buffer.append("#r");}
            color = upColor(buffer, color, "#cBE9786");
            buffer.append(vs[0]);
            buffer.append(" ");
            buffer.append(zffh(vs[1]));
            buffer.append(tianjia(vs[0]));
        }
        return;

    }
    /**套装属性*/
    public void showEw3(StringBuffer buffer, String value, String goodName){
        if(buffer.length()!=0){buffer.append("#r");}
        String color = upColor(buffer, null, "#c00ffff");
        buffer.append("【套装属性】");
        String[] v = value.split("&");
        for (int i = 4; i < v.length; i++) {
            String[] vs = v[i].split("=");
            if(buffer.length()!=0){buffer.append("#r");}
            color = upColor(buffer, color, "#c00ff00");//套装属性
            buffer.append(vs[0]);
            buffer.append(" ");
            buffer.append(zffh(vs[1]));
            buffer.append(tianjia(vs[0]));
        }
        if(buffer.length()!=0){buffer.append("#r");}
        color = upColor(buffer, null, "#c00ffff");
        buffer.append("【套装名称:");
        buffer.append(goodName.split("·")[0]);
        buffer.append("】品质:【");
        buffer.append(v[3]);
        buffer.append("】");
        int suitId = Integer.parseInt(v[1]);
        RoleSuitBean suit = UserMessUntil.getSuit(suitId);
        if (suit != null) {
            int sum = RoleProperty.getRoleProperty().getSuitSum(v[1]);
            String[] vs = suit.getHaveSkill().split("\\|");
            if(buffer.length()!=0){buffer.append("#r");}
            //套装图片
            List<Goodstable> qbtz = accessIdlEqu(2);
            RichLabel.num = new ArrayList<>();
            for(Goodstable goodstable:qbtz) {
                if(goodName.split("·")[0].equals(goodstable.getGoodsname().split("·")[0])) {
                    RichLabel.num.add(goodstable.getValue().split("\\|")[1].split("=")[1]);
                }
            }
            int tzid = suit.getSuitID();
            String[] tzids = suit.getHaveParts().split("\\|");
            if(tzids!=null && tzids.length>0) {
                for(String s : tzids) {
                    buffer.append("#9"+tzid+s);
                }
            }
            for (int i = 0; i < vs.length; i++) {
                String[] vss = vs[i].split("-");
                int maxsum = Integer.parseInt(vss[0]);
                Skill skill = UserMessUntil.getSkillId(vss[1]);
                if (skill != null) {
                    if(buffer.length()!=0){buffer.append("#r");}
                    //套装技能
//                	buffer.append("#"+skill.getSkillid());
                    if (sum >= maxsum) {
                        color = upColor(buffer, null, "#c00ff00");
                        buffer.append("[");
                        buffer.append(maxsum);
                    } else {
                        color = upColor(buffer, null, "#c807876");
                        buffer.append("[");
                        buffer.append(sum);
                    }
                    buffer.append("/");
                    buffer.append(maxsum);
                    buffer.append("]");
                    buffer.append(skill.getSkillname());
                }
            }
        }
    }

    /**宝石属性*/
    public void showEw4(StringBuffer buffer, String value){
        if(buffer.length()!=0){buffer.append("#r");}
        String color = upColor(buffer, null, "#c00ffff");
        buffer.append("【宝石镶嵌】");
        String[] v = value.split("&");
        for (int i = 1; i < v.length; i++) {
            Goodstable good = GoodsListFromServerUntil.fushis.get(new BigDecimal(v[i]));
            if (good != null) {
                if(buffer.length()!=0){buffer.append("#r");}
                //宝石图片
                buffer.append("#"+good.getSkin());
                color = upColor(buffer, null, "#cEA5700");
                buffer.append(good.getGoodsname());
                String[] bs = good.getValue().split("\\|");
                buffer.append(" ");
                buffer.append(bs[0].split("=")[1]);
                buffer.append("级 ");
                bs = bs[1].split("=");
                buffer.append(bs[0]);
                buffer.append(" ");
                buffer.append(zffh(bs[1]) + tianjia(bs[1]));
            }
        }
    }

    /**觉醒技展示处理*/
    public void showEw5(StringBuffer buffer,String value) {
        String[] split = value.split("&");
        Skill skill = UserMessUntil.getSkillId(split[1]);
        if (buffer.length()!=0) {buffer.append("#r");}//觉醒技
        long lvl = JpanelSummonEquipMain.expChangeLevel(Long.parseLong(split[3]));
        String color=upColor(buffer, null, "#cFFFF00");
        buffer.append("【觉醒技】 ");
        buffer.append(skill.getSkillname());
        buffer.append("(");
        buffer.append(split[2]);
        buffer.append(")");
        if (buffer.length()!=0) {buffer.append("#r");}//觉醒技等级
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【觉醒技等级】 ");
        buffer.append(lvl);
        if (buffer.length()!=0) {buffer.append("#r");}//类型
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【类型】 通用");
        if (buffer.length()!=0) {buffer.append("#r");}//技能介绍
        color = upColor(buffer, color, "#c00FF00");
        buffer.append(SummonSkillRemark(skill.getRemark(), skill, split[2], lvl + ""));
        if (buffer.length()!=0) {buffer.append("#r");}//简介
        color = upColor(buffer, color, "#cC5C583");
        buffer.append("铃、环、甲觉醒三合一，觉醒技方可生效");

    }
    /**五行属性展示处理*/
    public void showEw6(StringBuffer buffer,String value,String xz) {
        if (buffer.length()!=0) {buffer.append("#r");}
        String color=upColor(buffer, null, "#cFFFFFF");
        buffer.append("【五行】");
        String[] v = value.split("&");
        String[] starArray = xz!=null?xz.split("="):null;
        double num = 0;
        for (int i = 1; i < v.length; i++) {
            String[] vs = v[i].split("=");
            if (buffer.length()!=0) {buffer.append("#r");}
            color=upColor(buffer, color, "#cFFFF00");
            buffer.append(vs[0]);
            buffer.append(" ");
            buffer.append(vs[1]);
            buffer.append("/100");
            if (starArray!=null) {
                num += JpanelStarCardMain.fiveElementRestrainCreate(starArray[2], vs[0], vs[1]);
            }
        }
        if (starArray!=null) {
            if (buffer.length()!=0) {buffer.append("#r");}
            color=upColor(buffer, color, "#c4ADEDD");
            buffer.append("五行加成星阵之力 ");
            buffer.append(String.format("%.1f", num));
            buffer.append("%");
            if (buffer.length()!=0) {buffer.append("#r");}
            buffer.append("【星阵】");
            if (buffer.length()!=0) {buffer.append("#r");}
            buffer.append(starArray[1]);
            buffer.append("(");
            buffer.append(starArray[2]);
            buffer.append(")");
            if (isStarArrayName(starArray[1])) {
                buffer.append("#r#cFFFFFF赤帝宫 #c00FF00"+starArray[3]);
                buffer.append("#r#cFFFFFF青帝宫 #c00FF00"+starArray[4]);
                buffer.append("#r#cFFFFFF黄帝宫 #c00FF00"+starArray[5]);
                buffer.append("#r#cFFFFFF白帝宫 #c00FF00"+starArray[6]);
                buffer.append("#r#cFFFFFF黑帝宫 #c00FF00"+starArray[7]);
                color=null;
            }
            buffer.append("#r#c00FF00"+getStarArrayAttribute(starArray[1]));
        }else {
            buffer.append("#r#c4ADEDD无星阵，五行暂不生效");
        }
    }
    /**巫铸展示处理*/
    public String showEw7(StringBuffer buffer,String value,long type) {
        String xz=null;
        String color=null;
        String[] v = value.split("&");
        for (int i = 1; i < v.length; i++) {
            if (v[i].startsWith("星阵属性")) {xz=v[i];continue;}
            String[] vs = v[i].split("=");
            if (buffer.length()!=0) {buffer.append("#r");}
            color=upColor(buffer, color, true?"#c00EAFF":"#c00ff00");
            buffer.append(vs[0]);
            buffer.append(" ");
            buffer.append(zffh(vs[1]));
            buffer.append(tianjia(vs[0]));
        }
        return xz;
    }
    /**星卡属性展示*/
    public void showStarCard(String value) {
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        if (buffer.length()!=0) {buffer.append("#r");}//等级
        color=upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级】 ");
        buffer.append(v[0].substring(3));
        if (buffer.length()!=0) {buffer.append("#r");}//神力
        color=upColor(buffer, color, "#cFFFFFF");
        buffer.append("【神力】 ");
        color=upColor(buffer, color, "#cFFFF00");
        buffer.append(v[1].substring(3));
        buffer.append("/");
        buffer.append(Integer.parseInt(v[0].split("=")[1].split("/")[0])*200);
        if (buffer.length()!=0) {buffer.append("#r");}//战力
        color=upColor(buffer, color, "#cFFFFFF");
        buffer.append("【战力】 ");
        color=upColor(buffer, color, "#cFFFF00");
        buffer.append(v[2].substring(3));
        String xz=null;
        for (int i = 3; i < v.length; i++) {
            if (v[i].startsWith(BaptizeBtn.Extras[0])) {// 炼化
                xz=showEw0(buffer, v[i], 520);
            }else if (v[i].startsWith(BaptizeBtn.Extras[6])) {
                showEw6(buffer, v[i],xz);
            }
        }
        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT);//物品描述
    }
    /**展示翅膀属性*/
    public void showWing(String value){
//      品质=神迹|星级=15|经验=4000000|颜色=无|根骨=58|力量=39|灵性=46|敏捷=61|炼化属性&强力克水=22.6&强力克水=27.4&忽视抗风=7.7&忽视抗风=9.1
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        if (buffer.length()!=0) {buffer.append("#r");}//品质
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【品质】");
        String quality = v[0].substring(3);
        color = upColor(buffer, color, WingMainPanel.getQualityColorOx(quality));
        buffer.append(quality);
        if (buffer.length()!=0) {buffer.append("#r");}//星级
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【星级】");
        color = upColor(buffer, color, "#cFFFF00");
        String starLvl = v[1].substring(3);
        buffer.append(starLvl);
        buffer.append("/15");
        if (buffer.length()!=0) {buffer.append("#r");}//等级
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级】");
        String exp = v[2].substring(3);
        buffer.append(WingMainPanel.getWingLevel(exp));
        if (buffer.length()!=0) {buffer.append("#r");}//经验
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【经验】");
        buffer.append(exp);
        if (buffer.length()!=0) {buffer.append("#r");}//颜色
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【颜色】");
        buffer.append(v[3].substring(3));
        int parseIntStar = Integer.parseInt(starLvl);
        for (int i = 4; i < v.length; i++) {
            if(v[i].startsWith("力量") || v[i].startsWith("灵性") || v[i].startsWith("根骨") || v[i].startsWith("敏捷")){//四维属性
                String[] basics = v[i].split("=");
                if (buffer.length()!=0) {buffer.append("#r");}
                color = upColor(buffer, color, "#cCDCA6D");
                buffer.append(basics[0]);
                buffer.append(" ");
                buffer.append(WingMainFrame.getWingMainFrame().getWingMainPanel().getUpStarData(basics[1], parseIntStar, quality));
                color = upColor(buffer, color, "#cFFFFFF");
                buffer.append("(");
                buffer.append(basics[1]);
                buffer.append(")");
            }else if(v[i].startsWith(BaptizeBtn.Extras[0])){//炼化属性
                showEw0(buffer, v[i], 8888);
            }
        }
        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT);
    }

    /** 召唤兽装备*/
    public void showSummonEquip(String value,long type){
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        if (buffer.length()!=0) {buffer.append("#r");}//等级
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级】 ");
        buffer.append(v[0].substring(3));
        if (buffer.length()!=0) {buffer.append("#r");}//装备部位
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【装备部位】 ");
        buffer.append(v[1].substring(5));
        if (buffer.length()!=0) {buffer.append("#r");}//等级需求
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级需求】 ");
        buffer.append(v[2].substring(5));
        int i;
        for (i = 3; i < v.length; i++) {
            if(v[i].startsWith("品质")){
                break;
            }else{//黄字属性
                if (buffer.length()!=0) {buffer.append("#r");}
                color = upColor(buffer, color, "#cFFFFFF");
                String[] basics = v[i].split("=");
                buffer.append("【");
                buffer.append(basics[0]);
                buffer.append("】 ");
                buffer.append(basics[1]);
            }
        }
        if (buffer.length()!=0) {buffer.append("#r");}//品质
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【品质】 ");
        buffer.append(v[i].substring(3));
        buffer.append("/100");
        if (buffer.length()!=0) {buffer.append("#r");}//通灵
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【通灵】 ");
        int level = Integer.parseInt(v[0].substring(3));
        buffer.append(v[i+1].substring(3));
        buffer.append("/");
        buffer.append(level * 1000);
        boolean is = true;
        for (int j = i+2; j < v.length; j++) {
            if(v[j].startsWith(BaptizeBtn.Extras[0])){
                showEw0(buffer, v[j], type);
            }else if(v[j].startsWith(BaptizeBtn.Extras[5])){
                is = false;
                showEw5(buffer, v[j]);
            }
        }
        if(is){
            if (buffer.length()!=0) {buffer.append("#r");}//未开通觉醒技
            color = upColor(buffer, color, "#c00FDF1");
            buffer.append("未开启觉醒(开启铃、环、甲之觉醒，可领悟觉醒技)");
        }
        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT);
    }

    /** 伙伴装备属性展示*/
    public void showPalEquip(String value, long type){
//        等级=6|等级要求=140|性别要求=1|品质=黄金|加强三尸虫=6600|加强三尸虫回血程度=90|契合度=10000/10000|炼化属性&加三尸=622.8&加三尸=673.4&加三尸=613.0
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        int i = 0;
        if(buffer.length()!=0){buffer.append("#r");}//等级
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级】 ");
        buffer.append(v[i].substring(3));
        i++;
        if(buffer.length()!=0){buffer.append("#r");}//等级要求
        color = upColor(buffer, color, "#cFFFFFF");
        buffer.append("【等级要求】 ");
        buffer.append(v[i].substring(5));
        i++;
        if(v[i].startsWith("性别")){
            if(buffer.length()!=0){buffer.append("#r");}//性别要求
            color = upColor(buffer, color, "#c1E90FF");
            buffer.append("【性别要求】 ");
            String sex = v[i].substring(5);
            buffer.append((sex.equals("1") ? "男":sex.equals("0") ? "女":"全部性别"));
            i++;
        }
        if(buffer.length()!=0){buffer.append("#r");}//品质
        color = upColor(buffer, color, "#c1E90FF");
        buffer.append("【品质】 ");
        buffer.append(v[i].substring(3));
        i++;
        for (; i < v.length; i++) {
            if(v[i].startsWith("契合度")){
                break;
            }else{
                if(buffer.length()!=0){buffer.append("#r");}
                String[] split = v[i].split("=");
                color = upColor(buffer, color, "#cDEDE9E");
                buffer.append(split[0]);
                buffer.append(zffh(split[1]));
                buffer.append(tianjia(split[0]));
            }
        }
        if(buffer.length()!=0){buffer.append("#r");}//契合度
        color = upColor(buffer, color, "#cDEDE9E");
        buffer.append("契合度 ");
        buffer.append(v[i].substring(4));
        for (int j = i+1; j < v.length; j++) {
            showEw0(buffer, v[j], type);//炼化属性
        }
        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT);
    }

    /**展示人类装备*/
    public void showEquipment(String value, long type, Integer qhv,String goodname, Goodstable goodstable){
//        力量要求 根骨要求 敏捷要求 灵性要求  等级要求 等级 阶数 性别要求 装备角色  不是基础属性
        this.part = null;
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        String xz = null;
        for (int i = 0; i < v.length; i++) {
            if(v[i].startsWith(BaptizeBtn.Extras[0])){//炼化属性
                xz = showEw0(buffer, v[i], type);
            }else if(v[i].startsWith(BaptizeBtn.Extras[1])){//"炼器属性"
                showEw1(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[2])){//"神兵属性"
                showEw2(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[3])){//"套装属性"
                showEw3(buffer, v[i],goodname);
            } else if (v[i].startsWith(BaptizeBtn.Extras[4])) {//"宝石属性"
                showEw4(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[5])){//"觉醒技"
                showEw5(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[6])){//"五行属性"
                showEw6(buffer, v[i], xz);
            }else if (v[i].startsWith(BaptizeBtn.Extras[8])){//点翠属性
                showEw8( buffer, v[i], type);
            }else if(v[i].startsWith(BaptizeBtn.Extras[9])){//"巫铸属性"
                showEw7(buffer, v[i], type);
            }else if(v[i].startsWith(BaptizeBtn.Extras[10])){//"兽魂属性"
                showEw10(buffer, v[i],goodstable.getFysh());
            }else{
                String[] zhi = v[i].split("=");
                if(buffer.length()!=0){buffer.append("#r");}
                if (zhi[0].equals("装备角色") || zhi[0].equals("等级") || zhi[0].equals("等级需求") || zhi[0].equals("装备等级") || zhi[0].equals("阶数") || zhi[0].equals("套装品质")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【");
                    buffer.append(zhi[0]);
                    buffer.append("】");
                    buffer.append(zhi[1]);
                }else if (zhi[0].equals("最高携带等级")) {
                    color = upColor(buffer, color, "#c00ffff");
                    buffer.append("【");
                    buffer.append(zhi[0]);
                    buffer.append("】");
                    buffer.append(zhi[1]);
                }else if (zhi[0].equals("等级要求")||zhi[0].equals("力量要求") || zhi[0].equals("灵性要求") || zhi[0].equals("根骨要求") || zhi[0].equals("敏捷要求")) {
                    color = upColor(buffer, color, "#ce1df59");
                    buffer.append("");
                    buffer.append(zhi[0]);
                    buffer.append(" ");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("装备需求")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【装备需求】");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("装备部位")) {
                    String part = AccessSuitMsgUntil.returnPartsName(zhi[1]);
                    if (part != null) {zhi[1] = part;}
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【装备部位】");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("性别要求") || zhi[0].equals("性别")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【性别要求】");
                    buffer.append(zhi[1].equals("1")?"男":zhi[1].equals("0")?"女":"全部性别");
                } else if (zhi[0].equals("耐久")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("耐久:#G");
                    buffer.append(zhi[1].split(",")[0]);
                } else if (zhi[0].equals("培养")) {
                    color = upColor(buffer, color, "#c00ffff");
                    buffer.append("培养: #c00ffff");
                    buffer.append(zhi[1]);
                }else if (zhi[0].equals("神类属性")) {
                    color = upColor(buffer, color, "#cFFA500");
                    buffer.append("【神类属性】 #cFFA500");
                    buffer.append(zhi[1]);

                }  else {
                    if (zhi.length > 1) {
                        if (!zhi[0].equals("标签") && !zhi[0].equals("值")) {
                            color = upColor(buffer, color, "#ce1df59");//装备属性的颜色
                            buffer.append(zhi[0]);
                            buffer.append(" ");
                            buffer.append(zffh(zhi[1]));
                            buffer.append(tianjia(zhi[0]));
                            if(qhv != null && qhv>0){
                                color = upColor(buffer, color, "#G");
                                buffer.append(" ");
                                buffer.append("(");
                                buffer.append("+");
                                buffer.append(String.format("%.1f", RoleProperty.getQHGemXS(qhv)/100*Double.parseDouble(zhi[1])));
                                buffer.append(")");

                            }
                        }
                    }
                }
            }
        }
        box.addText(buffer.toString(), 265, UIUtils.TEXT_FONT);//装备属性字体
    }

    /**展示其他Goodstable*/
    public void showOther(String value,long type,int s){
        if (value==null||value.equals("")) {return;}
        String color=null;
        StringBuffer buffer=new StringBuffer();
        String[] v = value.split("\\|");
        String xz = null;
        for (int i = 0; i < v.length; i++) {
            if(v[i].startsWith(BaptizeBtn.Extras[0])){//炼化属性
                xz = showEw0(buffer, v[i], type);
            }else if(v[i].startsWith(BaptizeBtn.Extras[1])){//"炼器属性"
                showEw1(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[2])){//"神兵属性"
                showEw2(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[3])){//"套装属性"
                showEw3(buffer, v[i],null);
            }else if(v[i].startsWith(BaptizeBtn.Extras[10])){//"兽魂属性"
                showEw100(buffer, v[i],v[0], s);
            }else if(v[i].startsWith(BaptizeBtn.Extras[4])){//"宝石属性"
                showEw4(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[5])){//"觉醒技"
                showEw5(buffer, v[i]);
            }else if(v[i].startsWith(BaptizeBtn.Extras[6])){//"五行属性"
                showEw6(buffer, v[i], xz);
            }else if (v[i].startsWith(BaptizeBtn.Extras[8])){//点翠属性
                showEw8( buffer, v[i], type);
            }else if(v[i].startsWith(BaptizeBtn.Extras[9])){//"巫铸属性"
                showEw7(buffer, v[i], type);
            }else{
                String[] zhi = v[i].split("=");
                if(buffer.length()!=0){buffer.append("#r");}
                if (zhi[0].equals("装备角色") || zhi[0].equals("等级") || zhi[0].equals("装备等级") || zhi[0].equals("阶数") || zhi[0].equals("等级要求") || zhi[0].equals("力量要求") || zhi[0].equals("灵性要求") || zhi[0].equals("根骨要求") || zhi[0].equals("敏捷要求") || zhi[0].equals("套装品质")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【");
                    buffer.append(zhi[0]);
                    buffer.append("】");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("装备部位")) {
                    String part = AccessSuitMsgUntil.returnPartsName(zhi[1]);
                    if (part != null) {zhi[1] = part;}
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【装备部位】");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("性别要求") || zhi[0].equals("性别")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append("【性别要求】");
                    buffer.append(zhi[1].equals("1")?"男":zhi[1].equals("0")?"女":"全部性别");
                } else if (zhi[0].equals("HP%") || zhi[0].equals("MP%")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    String label = zhi[0].replaceAll("%", "");
                    buffer.append(label);
                    buffer.append(" ");
                    buffer.append(zffh(zhi[1]));
                    buffer.append("%");
                } else if (zhi[0].equals("HP") || zhi[0].equals("MP") || zhi[0].equals("经验") || zhi[0].equals("亲密") || zhi[0].equals("钱") || zhi[0].equals("点")) {
                    color = upColor(buffer, color, "#cFFFFFF");
                    buffer.append(zhi[0]);
                    buffer.append(" ");
                    buffer.append(zffh(zhi[1]));
                } else if (zhi[0].equals("力量") || zhi[0].equals("灵性") || zhi[0].equals("根骨") || zhi[0].equals("敏捷")) {
                    color = upColor(buffer, color, "#cCCCC99");
                    buffer.append(zhi[0]);
                    buffer.append(" ");
                    buffer.append(zffh(zhi[1]));
                } else if (zhi[0].equals("培养") || zhi[0].equals("品质")) {
                    color = upColor(buffer, color, "#c1E90FF");
                    buffer.append(zhi[0]);
                    buffer.append(" ");
                    buffer.append(zffh(zhi[1]));
                } else if (zhi[0].equals("坐标") || zhi[0].equals("内丹等级")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append(zhi[0]);
                    buffer.append(":");
                    buffer.append(zffh(zhi[1]));
                } else if (zhi[0].equals("次数")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("炼妖次数")) {
                    color = upColor(buffer, color, "#c00BFFF");
                    buffer.append(zhi[0]);
                    buffer.append(" ");
                    buffer.append(zffh(zhi[1]));
                } else if (zhi[0].equals("描述") || zhi[0].equals("名称")) {
                    color = upColor(buffer, color, "#c00BFFF");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("传送") || zhi[0].equals("宝图")) {
                    String[] vs = zhi[1].split(",");
                    int x = Integer.parseInt(vs[2]) / 20;
                    int y = Integer.parseInt(vs[3]) / 20;
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("坐标: ");
                    buffer.append(vs[1]);
                    buffer.append("(");
                    buffer.append(x);
                    buffer.append(",");
                    buffer.append(y);
                    buffer.append(")");
                } else if (zhi[0].equals("可用次数")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("还可以使用");
                    buffer.append(zhi[1]);
                    buffer.append("次");
                } else if (zhi[0].equals("技能")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("技能:#G");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("技能等级")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("技能等级:#G");
                    buffer.append(zhi[1]);
                } else if (zhi[0].equals("耐久")) {
                    color = upColor(buffer, color, "#cFFFF33");
                    buffer.append("耐久:#G");
                    buffer.append(zhi[1].split(",")[0]);
                } else if (zhi[0].equals("场数")) {
                    buffer.append("");
                }else  if (zhi[0].matches("\\d+")&&UserMessUntil.getSkillId(zhi[0])!=null){
                    color = this.upColor(buffer, color, "#cDEDE9E");
                    buffer.append("技能：");
                    color = this.upColor(buffer, color, "#c00dd00");
                    buffer.append(UserMessUntil.getSkillId(zhi[0]).getSkillname()+":"+zhi[1]+"级");
                } else if (zhi[0].equals("随机靓号")) {
                    buffer.append("");
                } else if (zhi[0].equals("靓号ID")) {
                    buffer.append("#G靓号ID:#Y");
                    buffer.append(zhi[1]);
                } else {
                    if (zhi.length > 1) {
                        if (!zhi[0].equals("召唤兽") && !zhi[0].equals("物品") && !zhi[0].equals("标签") && !zhi[0].equals("值") && !zhi[0].equals("皮肤") && !zhi[0].equals("方向") && !zhi[0].equals("变身卡类") && !zhi[0].equals("lvl") && !zhi[0].equals("刮奖") && !zhi[0].equals("卡类")) {
                            color = upColor(buffer, color, "#cDEDE9E");
                            buffer.append(zhi[0]);
                            buffer.append(" ");
                            buffer.append(zffh(zhi[1]));
                            buffer.append(tianjia(zhi[0]));
                        }
                    }
                }
            }
        }
        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT);
    }
    private String zhizuo;
    private Goodstable goodsss;
    /**展示物品*/
    public int showGood(Goodstable good){
        jy=AnalysisString.jiaoyi(good.getQuality());
        type = good.getType();
        this.goodsss = good;
        lock=good.getGoodlock();
        if(good.getType()!=60007) {
            labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath(good.getSkin()));
        }else {
            labgoodsimg.setIcon(null);
        }
        labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath(good.getSkin()));
        if(good.getType()!=60007) {
            labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath(good.getSkin()));
        }else {
            labgoodsimg.setIcon(null);
        }
        if (good.getValue() != null) {
            final String[] vcs = good.getValue().split("\\|");
            int i = 0;
            while (i < vcs.length) {
                final String[] zhi = vcs[i].split("=");
                if (zhi[0].equals("制作人")) {
                    this.zhizuo = zhi[1];
                }
                ++i;
            }
        }
        if (good.getQht()!=null&&good.getQht()>0) {
            StringBuffer buffer=new StringBuffer();
            buffer.append("#Y");
            buffer.append(good.getGoodsname());
            buffer.append("#r");
            for (int i = 1; i < good.getQht(); i++) {
                if(good.getQhv()==null||i>good.getQhv()) {
                    buffer.append("#880");
                } else if(i<4) {
                    buffer.append("#882");//蓝
                } else if(4<=i && i<7) {
                    buffer.append("#883");//绿
                } else if(7<=i && i<10) {
                    buffer.append("#881");//黄
                }else if(10<=i && i<13) {
                    buffer.append("#884");//红
                }else {
                    buffer.append("#885");//亮黄
                }
            }
            box.removeAddText(buffer.toString(), 235,UIUtils.TEXT_COM_FONT);
        }else {
            box.removeAddText("#Y"+good.getGoodsname(), 235,UIUtils.TEXT_COM_FONT);
        }
        if (good.getInstruction()!=null&&!good.getInstruction().equals("")) {
            box.addText(good.getInstruction(), 255, UIUtils.TEXT_FONT);//仙器装备物品说明描述
        }
        if (!Goodtype.CancelMsg(good.getType())) {//展示属性
            if (good.getType()==520) {//星卡
                showStarCard(good.getValue());
            }else if (good.getType()==8888) {//翅膀
                showWing(good.getValue());
            }else if (Goodtype.isSummonEquip(good.getType())) {//召唤兽装备
                showSummonEquip(good.getValue(), good.getType());
            }else if (Goodtype.isPalEquip(good.getType())) {//伙伴装备类
                showPalEquip(good.getValue(), good.getType());
            }

            else if (Goodtype.EquipmentType(good.getType())!=-1) {//人物装备类
                showEquipment(good.getValue(), good.getType(),good.getQhv(),good.getGoodsname(),good);
                code = good.getRgid().longValue();//只有装备才显示编号
            }
            //这个屏蔽可以显示，但是预览没有加属性数字，上装有加属性

            else {//其他类
                showOther(good.getValue(),good.getType(),good.getSbjljd());
            }
        }
        if (box.getHeight() < 140) gheight = 160;
        else gheight = box.getHeight() + 20;
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    /**展示Shop属性*/
    public int showShop(Shop shop){
        jy=false;
        if(shop.getQualiy()!=null){
            if(shop.getQualiy()%2 != 0 && shop.getQualiy()!=0){
                jy = true;
            }
        }
        lock=0;
        type = 0;
        labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath(shop.getShopskin()));
        box.removeAddText("#Y"+shop.getShopname(), 255,UIUtils.TEXT_COM_FONT);
        if (shop.getShoptext()!=null&&!shop.getShoptext().equals("")) {
            box.addText(shop.getShoptext(), 235, UIUtils.TEXT_FONT);//物品描述
        }
        int shoptype = shop.getShoptype();
        if (!Goodtype.CancelMsg(shoptype)) {//展示属性
            showOther(shop.getValue(),shoptype,0);
        }
        if (box.getHeight() < 140) gheight = 160;
        else gheight = box.getHeight() + 20;
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    /**展示Eshop物品*/
    public int showEshop(Eshop eshop){
        jy=false;
        if(eshop.getQunliy()!=null){
            if(eshop.getQunliy()%2 != 0 && eshop.getQunliy()!=0){
                jy = true;
            }
        }
        lock=0;
        type = 0;
        labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath(eshop.getEshopskin()));
        box.removeAddText("#Y"+eshop.getEshopname(), 235,UIUtils.TEXT_COM_FONT);
        if (eshop.getEshoptext()!=null&&!eshop.getEshoptext().equals("")) {
            box.addText(eshop.getEshoptext(), 235, UIUtils.TEXT_FONT);//物品描述
        }
        if (box.getHeight() < 140) gheight = 160;
        else gheight = box.getHeight() + 20;
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }
    /**展示PayvipBean*/
    public int showPayvipBean(PayvipBean payvipBean){
        jy=false;
        lock=0;
        type = 0;
        labgoodsimg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("S"+payvipBean.getGrade(),120,120));
        box.removeAddText("#Y"+"V" + payvipBean.getGrade() + "会员奖励", 235,UIUtils.TEXT_COM_FONT);
        if (payvipBean.getInstructiontext()!=null&&!payvipBean.getInstructiontext().equals("")) {
            box.addText(payvipBean.getInstructiontext(), 235, UIUtils.TEXT_FONT);//物品描述
        }
        if (box.getHeight() < 140) gheight = 160;
        else gheight = box.getHeight() + 20;
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }
    public int showRoleTxBean(RoleTxBean roleTxBean){
        jy=true;
        lock=0;
        type = 0;
        labgoodsimg.setIcon(GoodsListFromServerUntil.imgpath("tx"+roleTxBean.getRdId()));
        box.removeAddText("#Y"+ roleTxBean.getRdName(), 235,UIUtils.TEXT_COM_FONT);
        if (roleTxBean.getRdAsk()!=null&&!roleTxBean.getRdAsk().equals("")) {
            box.addText(roleTxBean.getRdAsk(), 235, UIUtils.TEXT_FONT);//物品描述
        }
        if (box.getHeight() < 140) gheight = 160;
        else gheight = box.getHeight() + 20;
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    //根骨 力量 灵性 敏捷 速度 加速度 sp SP
    //抗 加强
    //伤害 率 躲闪 狂暴
    /***/
    public int goodmsg(ImageIcon icon, String goodname, String goodtext, String goodvalue, boolean jiaoyi, int goodlock,long type, String gemValue) {
        jy = jiaoyi;
        lock = goodlock;
        labgoodsimg.setIcon(icon);
        box.removemsg();
        box.addText("#Y"+goodname, 235, UIUtils.TEXT_COM_FONT);//物品名称
        if (gemValue!=null) {
            box.addText(gemValue, 235, UIUtils.TEXT_FONT);//宝石炼化
        }
        box.addText(goodtext!=null?goodtext:"", 235, UIUtils.TEXT_FONT);//物品描述
        goodmsg(goodvalue,type);
        if (box.getHeight() < 140) {
            gheight = 160;
        } else {
            gheight = box.getHeight() + 20;
        }
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    /**
     * 物品描述private JLabel labgoodsimg;//物品的图像 private JLabel labgoodsname;//物品名称 private JTextArea areagoodsmsg;//物品介绍 private JLabel labgoodsvalue;
     *
     * @return
     */
    public int goodsWingmsg(ImageIcon icon, String goodname, String goodtext, String goodvalue, boolean jiaoyi, int goodlock) {
        jy = jiaoyi;
        lock = goodlock;
        labgoodsimg.setIcon(icon);
        box.removemsg();
        // 物品名称
        box.addText("#Y" + goodname, 235, UIUtils.TEXT_FONT2);
        // 物品描述
        if (goodtext != null) {
            box.addText(goodtext, 235, UIUtils.TEXT_FONT);
        } else {
            box.addText("", 235, UIUtils.TEXT_FONT);
        }
        goodsWingmsg(goodvalue);
        if (box.getHeight() < 140) {
            gheight = 160;
        } else {
            gheight = box.getHeight() + 20;
        }
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }


    /**
     * 物品描述private JLabel labgoodsimg;//物品的图像 private JLabel labgoodsname;//物品名称 private JTextArea areagoodsmsg;//物品介绍 private JLabel labgoodsvalue;
     *
     * @return
     */
    public int goodsStarCard(ImageIcon icon, String goodname, String goodtext, String goodvalue, boolean jiaoyi, int goodlock) {
        jy = jiaoyi;
        lock = goodlock;
        labgoodsimg.setIcon(icon);
        box.removemsg();
        // 物品名称
        box.addText("#Y" + goodname, 235, UIUtils.TEXT_FONT2);
        // 物品描述
        if (goodtext != null) {
            box.addText(goodtext, 235, UIUtils.TEXT_FONT);
        } else {
            box.addText("", 235, UIUtils.TEXT_FONT);
        }
        goodsStarCard(goodvalue);
        if (box.getHeight() < 140) {
            gheight = 160;
        } else {
            gheight = box.getHeight() + 20;
        }
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    /**
     * 物品描述private JLabel labgoodsimg;//物品的图像 private JLabel labgoodsname;//物品名称 private JTextArea areagoodsmsg;//物品介绍 private JLabel labgoodsvalue;
     *
     * @return
     */
    public int goodsSummonEquipmsg(ImageIcon icon, String goodname, String goodtext, String goodvalue, boolean jiaoyi, int goodlock) {
        jy = jiaoyi;
        lock = goodlock;
        labgoodsimg.setIcon(icon);
        box.removemsg();
        // 物品名称
        box.addText("#Y" + goodname, 235, UIUtils.TEXT_FONT2);
        // 物品描述
        if (goodtext != null) {
            box.addText(goodtext, 235, UIUtils.TEXT_FONT);
        } else {
            box.addText("", 235, UIUtils.TEXT_FONT);
        }
        goodsSummonEquipmsg(goodvalue);
        if (box.getHeight() < 140) {
            gheight = 160;
        } else {
            gheight = box.getHeight() + 20;
        }
        this.setPreferredSize(new Dimension(gwidth, gheight));
        imgZoom.setMiddlew(gwidth - 2 * imgZoom.getEdgew());
        imgZoom.setMiddleh(gheight - 2 * imgZoom.getEdgeh());
        return gheight;
    }

    // 召唤兽装备value拆解
    public void goodsSummonEquipmsg(String value) {
//		Integer level = 1;
        if (value != null && !value.equals("")) {
            String[] split = value.split("\\|");
            boolean is = true;
            for (int i = 0; i < split.length; i++) {
                goodsSummonEquipValueMessage(split[i], split);
                if (split[i].startsWith("觉醒技")) {
                    is = false;
                }
            }
            if (is) {
                box.addText("#c00FDF1未开启觉醒（开启铃、环、甲之觉醒，可领悟觉醒技）", 235, UIUtils.TEXT_FONT);
            }
        }
    }

    // 召唤兽装备物品描述:等级=xxx|装备部位=xxx|等级需求=xxx| {黄字属性} |品质=xxx|通灵=xxx| {炼化属性} |
    // {觉醒技属性}
    public void goodsSummonEquipValueMessage(String message, String[] value) {
        if (message.startsWith("炼化属性")) {
            String[] split = message.split("&");
            for (int i = 1; i < split.length; i++) {
                String[] split2 = split[i].split("=");
                if (split2[0].endsWith("等级")) {
                    box.addText("#c00ff00" + split2[0] + " " + split2[1] + "级", 235, UIUtils.TEXT_FONT);
                } else {
                    box.addText("#c00ff00" + split2[0] + " " + zffh(split2[1]) + tianjia(split2[0]), 235, UIUtils.TEXT_FONT);
                }
            }
        } else if (message.startsWith("觉醒技")) {
            String[] split = message.split("&");
            Skill skill = UserMessUntil.getSkillId(split[1]);
            if (skill != null) {
                box.addText(" #r", 235, UIUtils.TEXT_FONT);
                long lvl = JpanelSummonEquipMain.expChangeLevel(Long.parseLong(split[3]));
                box.addText("#cFFFF00【觉醒技】 " + skill.getSkillname() + "(" + split[2] + ")", 235, UIUtils.TEXT_FONT);
                box.addText("#cFFFFFF【觉醒技等级】" + lvl, 235, UIUtils.TEXT_FONT);
                box.addText("#cFFFFFF【类型】 通用", 235, UIUtils.TEXT_FONT);
                box.addText("#c00FF00" + SummonSkillRemark(skill.getRemark(), skill, split[2], lvl + ""), 235, UIUtils.TEXT_FONT);

                box.addText("#cC5C583 铃、环、甲觉醒三合一，觉醒技方可生效", 235, UIUtils.TEXT_FONT);
            }
        } else {
            String[] split = message.split("=");
            if (split[0].equals("等级")) {
                box.addText("#cFFFFFF【" + split[0] + "】 " + split[1], 235, UIUtils.TEXT_FONT);
            } else if (split[0].equals("装备部位")) {
                box.addText("#cFFFFFF【" + split[0] + "】 " + split[1], 235, UIUtils.TEXT_FONT);
            } else if (split[0].equals("品质")) {
                box.addText("#cFFFF00【" + split[0] + "】 " + split[1] + "/100", 235, UIUtils.TEXT_FONT);
            } else if (split[0].equals("通灵")) {
                int level = Integer.parseInt(JframeSummonEquipMain.getJframeSummonEquipMain().getJpanelSummonEquipMain().getValuesMessage(value, "等级"));
                box.addText("#cFFFF00【" + split[0] + "】 " + split[1] + "/" + level * 1000, 235, UIUtils.TEXT_FONT);
            } else {
                box.addText("#cFFFF00【" + split[0] + "】 " + split[1], 235, UIUtils.TEXT_FONT);
            }
        }
    }

    /**
     * 召唤兽装备技能替换公式<br>
     * 公式一 value*星级/5* 等级开根号 <br>
     * 公式二 value*星级/5* 等级开根号*0.8 <br>
     * 公式三 value*星级/5* 等级开根号*0.7<br>
     * 公式四 value*星级/5* 等级开根号*0.3 <br>
     * 公式五 100- value*星级/5* 等级开根号<br>
     * 公式六 value*星级/5* 等级开根号*0.25<br>
     * 公式七 100+value*星级/5* 等级开根号 <br>
     * 公式八 1+value*星级/5* 等级开根号*0.07 <br>
     * 公式九 value*星级/5* 等级开根号*0.5<br>
     * 公式十 value*星级/5* 等级开根号*0.05
     *
     * @param remark
     * @return
     */
    public static String SummonSkillRemark(String remark, Skill skill, String sld, String lvl) {
        remark = remark.replace("{公式一}", "#R" + (int) Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))) + "#G");
        remark = remark.replace("{公式二}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.8")) + "#G");
        remark = remark.replace("{公式三}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.7")) + "#G");
        remark = remark.replace("{公式四}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.3")) + "#G");
        remark = remark.replace("{公式五}", "#R" + (int) Arith.sub(Double.parseDouble("100"), Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl)))) + "#G");
        remark = remark.replace("{公式六}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.25")) + "#G");
        remark = remark.replace("{公式七}", "#R" + (int) Arith.add(Double.parseDouble("100"), Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl)))) + "#G");
        remark = remark.replace("{公式八}", "#R" + (int) Arith.add(Double.parseDouble("1"), Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.07"))) + "#G");
        remark = remark.replace("{公式九}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.5")) + "#G");
        remark = remark.replace("{公式十}", "#R" + (int) Arith.mul(Arith.mul(Arith.div(Arith.mul(Double.parseDouble(skill.getValue()), Double.parseDouble(sld)), 5, 0), Math.sqrt(Double.parseDouble(lvl))), Double.parseDouble("0.05")) + "#G");
        return remark;
    }
    /** 物品描述 */
    public void goodmsg(String value,long type) {
        if (value != null && !value.equals("")) {
            String[] v = value.split("\\|");
            for (int i = 0; i < v.length; i++) {
                goodmsg1(v[i],type);
            }
        }
    }
    /**翅膀物品描述 品质 星级 等级 经验 幻化*/
    public void goodsWingmsg(String value) {
        if (value != null && !value.equals("")) {
            String[] v = value.split("\\|");
            for (int i = 0; i < v.length; i++) {
                goodsWingmsg1(v[i], v);
            }
        }
    }
    /**星卡物品描述*/
    public void goodsStarCard(String value) {
        if (value != null && !value.equals("")) {
            String[] v = value.split("\\|");
            for (int i = 0; i < v.length; i++) {
                goodsStarCard(v[i], v);
            }
        }
    }
    /** 翅膀value拆解*/
    public void goodsWingmsg1(String field, String[] valueSplit) {
        if (field.length() >= 4) {
            String vj = field.substring(0, 4);
            if (vj.equals("炼化属性")) {
                box.addText("#c978FC3【炼化属性】", 235, UIUtils.TEXT_FONT);
                String[] v = field.split("&");
                for (int i = 1; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    if (!vs[0].equals("特技")) {
                        box.addText("#c00ff00" + vs[0] + " " + zffh(vs[1]) + tianjia(vs[0]), 235, UIUtils.TEXT_FONT);
                    } else {
                        box.addText("#c868090特技", 235, UIUtils.TEXT_FONT);
                        for (int j = 1; j < vs.length; j++) {
                            Skill skill = UserMessUntil.getSkillId(vs[j]);
                            if (skill != null) {
                                box.addText("#c868090" + skill.getSkillname() + ":" + skill.getRemark(), 235, UIUtils.TEXT_FONT);
                            }
                        }
                    }
                }
                return;
            }
        }
        String[] zhi = field.split("=");
        if (zhi[0].equals("品质")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + WingMainPanel.getQualityColorOx(zhi[1]) + zhi[1], 235, UIUtils.TEXT_FONT);
        } else if (zhi[0].equals("星级")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】#cFFFF00 " + zhi[1] + "/15", 235, UIUtils.TEXT_FONT);
        } else if (zhi[0].equals("经验")) {
            box.addText("#cFFFFFF【等级】 " + WingMainPanel.getWingLevel(zhi[1]), 235, UIUtils.TEXT_FONT);
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + zhi[1], 235, UIUtils.TEXT_FONT);
        } else if (zhi[0].equals("颜色")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + zhi[1], 235, UIUtils.TEXT_FONT);
        } else if (zhi[0].equals("力量") || zhi[0].equals("灵性") || zhi[0].equals("根骨") || zhi[0].equals("敏捷")) {
            int parseIntStar = Integer.parseInt(WingMainFrame.getWingMainFrame().getWingMainPanel().getGoodsValue(valueSplit, "星级"));
            String qualityAttr = WingMainFrame.getWingMainFrame().getWingMainPanel().getGoodsValue(valueSplit, "品质");
            box.addText("#cCDCA6D" + zhi[0] + " " + WingMainFrame.getWingMainFrame().getWingMainPanel().getUpStarData(zhi[1], parseIntStar, qualityAttr) + "#cFFFFFF(" + zhi[1] + ")", 235, UIUtils.TEXT_FONT);
        } else {
            if (zhi.length > 1) {
                if (!zhi[0].equals("召唤兽") && !zhi[0].equals("物品") && !zhi[0].equals("标签") && !zhi[0].equals("值") && !zhi[0].equals("皮肤") && !zhi[0].equals("方向") && !zhi[0].equals("变身卡类") && !zhi[0].equals("lvl") && !zhi[0].equals("刮奖") && !zhi[0].equals("卡类")) {
                    box.addText("#cDEDE9E" + zhi[0] + " " + zffh(zhi[1]) + tianjia(zhi[0]), 235, UIUtils.TEXT_FONT);
                }
            }
        }

    }
    /**星卡value拆解*/
    public void goodsStarCard(String field, String[] valueSplit) {
        if (field.length() >= 4) {
            String vj = field.substring(0, 4);
            if (vj.equals("炼化属性")) {
                String[] v = field.split("&");
                String[] split = v[1].split("=");
                if (split[0].equals("资质"))
                    box.addText("#cFFFFFF【神通】" + split[0] + " " + split[1] + "/100", 235, UIUtils.TEXT_FONT78);
                for (int i = 2; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    if (!vs[0].equals("星阵属性")) {
                        box.addText("#c00ff00" + vs[0] + " " + zffh(vs[1]) + tianjia(vs[1]), 235, UIUtils.TEXT_FONT78);
                    }
                }
                return;
            } else if (vj.equals("五行属性")) {
                box.addText("#cFFFFFF【五行】", 235, UIUtils.TEXT_FONT78);
                String[] v = field.split("&");
                String[] split = valueSplit[3].split("&");
                boolean is = true;
                if (split.length > 4) {
                    String[] starArray = split[4].split("=");
                    double num = 0;
                    for (int i = 1; i < v.length; i++) {
                        String[] vs = v[i].split("=");
                        box.addText("#cFFFF00" + vs[0] + " " + vs[1] + "/100", 235, UIUtils.TEXT_FONT78);
                        num += JpanelStarCardMain.fiveElementRestrainCreate(starArray[2], vs[0], vs[1]);

                    }
                    box.addText("#c4ADEDD" + "五行加成星阵之力 " + String.format("%.1f", num) + "%", 235, UIUtils.TEXT_FONT78);
                    is = false;
                    box.addText("#c4ADEDD【星阵】", 235, UIUtils.TEXT_FONT);
                    box.addText("#c4ADEDD" + starArray[1] + "(" + starArray[2] + ")", 235, UIUtils.TEXT_FONT78);
                    if (isStarArrayName(starArray[1])) {
                        box.addText("#cFFFFFF" + "赤帝宫 #c00FF00" + starArray[3], 235, UIUtils.TEXT_FONT78);
                        box.addText("#cFFFFFF" + "青帝宫 #c00FF00" + starArray[4], 235, UIUtils.TEXT_FONT78);
                        box.addText("#cFFFFFF" + "黄帝宫 #c00FF00" + starArray[5], 235, UIUtils.TEXT_FONT78);
                        box.addText("#cFFFFFF" + "白帝宫 #c00FF00" + starArray[6], 235, UIUtils.TEXT_FONT78);
                        box.addText("#cFFFFFF" + "黑帝宫 #c00FF00" + starArray[7], 235, UIUtils.TEXT_FONT78);
                    }
                    box.addText("#c00FF00" + getStarArrayAttribute(starArray[1]), 235, UIUtils.TEXT_FONT78);

                } else {
                    for (int i = 1; i < v.length; i++) {
                        String[] vs = v[i].split("=");
                        box.addText("#cFFFF00" + vs[0] + " " + vs[1] + "/100", 235, UIUtils.TEXT_FONT78);
                    }
                }
                if (is) {
                    box.addText("#c4ADEDD无星阵，五行暂不生效", 235, UIUtils.TEXT_FONT78);
                }
                return;
            }
        }
        String[] zhi = field.split("=");
        if (zhi[0].equals("品质")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + WingMainPanel.getQualityColorOx(zhi[1]) + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("神力")) {
            int lvlNow = Integer.parseInt(valueSplit[0].split("=")[1].split("/")[0]);
            box.addText("#cFFFFFF【" + zhi[0] + "】#cFFFF00 " + zhi[1] + "/" + lvlNow * 200, 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("战力")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】#cFFFF00 " + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("等级")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + zhi[1], 235, UIUtils.TEXT_FONT78);
        }  else if (zhi[0].equals("等级需求")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + zhi[1], 235, UIUtils.TEXT_FONT78);
        }
        else if (zhi[0].equals("颜色")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】 " + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("力量") || zhi[0].equals("灵性") || zhi[0].equals("根骨") || zhi[0].equals("敏捷")) {
            int parseIntStar = Integer.parseInt(WingMainFrame.getWingMainFrame().getWingMainPanel().getGoodsValue(valueSplit, "星级"));
            String qualityAttr = WingMainFrame.getWingMainFrame().getWingMainPanel().getGoodsValue(valueSplit, "品质");
            box.addText("#cCDCA6D" + zhi[0] + " " + WingMainFrame.getWingMainFrame().getWingMainPanel().getUpStarData(zhi[1], parseIntStar, qualityAttr) + "#cFFFFFF(" + zhi[1] + ")", 235, UIUtils.TEXT_FONT78);
        } else {
            if (zhi.length > 1) {
                if (!zhi[0].equals("召唤兽") && !zhi[0].equals("物品") && !zhi[0].equals("标签") && !zhi[0].equals("值") && !zhi[0].equals("皮肤") && !zhi[0].equals("方向") && !zhi[0].equals("变身卡类") && !zhi[0].equals("lvl") && !zhi[0].equals("刮奖") && !zhi[0].equals("卡类")) {
                    box.addText("#cDEDE9E" + zhi[0] + " " + zffh(zhi[1]) + tianjia(zhi[0]), 235, UIUtils.TEXT_FONT78);
                }
            }
        }
    }
    /** 判断是否是四神兽 */
    public boolean isStarArrayName(String name) {
        if (name.equals("朱雀") || name.equals("青龙") || name.equals("白虎") || name.equals("玄武"))
            return true;
        return false;
    }
    /** 根据星阵名称判断星阵的属性 */
    public String getStarArrayAttribute(String name) {
        if (name.equals("朱雀"))
            return "瑕疵:略微减少全队冰混睡忘抗性";
        else if (name.equals("青龙"))
            return "瑕疵:略微减少全队仙法抗性";
        else if (name.equals("白虎"))
            return "瑕疵:略微减少全队鬼火、三尸虫抗性";
        else if (name.equals("玄武"))
            return "瑕疵:略微减少全队震慑抗性";
        else if (name.equals("金牛"))
            return "本方所有人物、召唤兽对敌方造成的物理伤害有一定的加成";
        else if (name.equals("火猿"))
            return "若对方灵宝对本方任意单位造成伤害，抵抗一定程度伤害；每2回合可生效一次";
        else if (name.equals("赤马"))
            return "本方所有人物、召唤兽获得一定经验加成";
        else if (name.equals("黄鹤"))
            return "本方所有人物增加冰混睡忘抗性";
        else
            return "本方所有人物、召唤兽的仙法、鬼火、震慑有一定加成";
    }
    /**不需要添加%的属性值*/
    public static String tianjia(String v) {
        if (v.indexOf("抗") != -1) {
            if (v.equals("抗三尸虫") || v.equals("抗三尸") || v.equals("抗浩然正气") || v.equals("抗青面獠牙") || v.equals("抗天魔解体") || v.equals("抗小楼夜哭") || v.equals("抗分光化影") || v.equals("抗毒伤")) {
                return "";
            }
            return "%";
        }
        if (v.indexOf("强") != -1 ||
                v.indexOf("程度") != -1 ||
                v.indexOf("率") != -1  ||
                v.indexOf("附加混") != -1||
                v.indexOf("附加封") != -1||
                v.indexOf("狂暴") != -1 ||
                v.indexOf("命中") != -1 ||
                v.indexOf("致命") != -1 ||
                v.indexOf("忽视") != -1 ||
                v.indexOf("属性需求") != -1
                || v.indexOf("附加中毒攻击") != -1
                || v.indexOf("附加风法攻击") != -1
                || v.indexOf("附加火法攻击") != -1
                || v.indexOf("附加水法攻击") != -1
                || v.indexOf("附加雷法攻击") != -1
                || v.indexOf("附加震慑攻击") != -1
                || v.indexOf("附加三尸攻击") != -1
        ) {
            if (!v.equals("加强三尸虫") && v.indexOf("次数") == -1 && !v.endsWith("值")) {
                return "%";
            }
        }
        return "";
    }
    /**正负号判断*/
    public static String zffh(String v) {
        StringBuffer buffer = new StringBuffer();
        try {
            double z = Double.parseDouble(v);
            if (z > 0)
                buffer.append("+");//装备属性加号
            String[] vs = v.split("\\.");
            buffer.append(vs[0]);
            if (vs.length >= 2) {
                buffer.append(".");
                buffer.append(vs[1].charAt(0));
            }
            return buffer.toString();
        } catch (Exception e) {
        }
        return v;
    }
    public void goodmsg1(String field,long type) {
        if (field.length() >= 4) {
            if (field.startsWith("炼化属性")) {
                boolean is=Goodtype.GodEquipment_God(type)||Goodtype.GodEquipment_xian(type)||Goodtype.GodEquipment_Ding(type);
                String[] v = field.split("&");
                for (int i = 1; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    if (!vs[0].equals("特技")) {
                        //装备炼化属性显示颜色
                        box.addText((is?"#c00f8f8":"#c00ff00") + vs[0] + " " + zffh(vs[1]) + tianjia(vs[0]), 235, UIUtils.TEXT_FONT78);
                    } else {
                        box.addText("#c868090特技", 235, UIUtils.TEXT_FONT78);
                        for (int j = 1; j < vs.length; j++) {
                            Skill skill = UserMessUntil.getSkillId(vs[j]);
                            if (skill != null) {
                                box.addText("#c868090" + skill.getSkillname() + ":" + skill.getRemark(), 235, UIUtils.TEXT_FONT78);
                            }
                        }
                    }
                }
                return;
            } else if (field.startsWith("炼器属性")) {
                String[] v = field.split("&");
                box.addText("#W【炼器】#c00EAFF开光次数 "+v[1], 235, UIUtils.TEXT_FONT78);
                for (int i = 2; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    box.addText("#c00ff00" + vs[0] + " " + zffh(vs[1]) + tianjia(vs[0]), 235, UIUtils.TEXT_FONT78);
                }
                return;
            } else if (field.startsWith("神兵属性")) {
                String[] v = field.split("&");
                for (int i = 1; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    box.addText("#cBE9786" + vs[0] + " " + zffh(vs[1]) + tianjia(vs[0]), 235, UIUtils.TEXT_FONT78);
                }
                return;
            } else if (field.startsWith("套装属性")) {
                box.addText("#c00ffff【套装属性】", 235, UIUtils.TEXT_FONT78);
                String[] v = field.split("&");
                for (int i = 4; i < v.length; i++) {
                    String[] vs = v[i].split("=");
                    box.addText("#c00ff00" + vs[0] + " " + zffh(vs[1]) + tianjia(vs[0]), 235, UIUtils.TEXT_FONT78);
                }
                box.addText("#c00ffff【套装品质:" + v[3] + "】", 235, UIUtils.TEXT_FONT78);
                int suitId = Integer.parseInt(v[1]);
                RoleSuitBean suit = UserMessUntil.getSuit(suitId);
                if (suit != null) {
                    int sum = RoleProperty.getRoleProperty().getSuitSum(v[1]);
                    String[] vs = suit.getHaveSkill().split("\\|");
                    for (int i = 0; i < vs.length; i++) {
                        String[] vss = vs[i].split("-");
                        int maxsum = Integer.parseInt(vss[0]);
                        Skill skill = UserMessUntil.getSkillId(vss[1]);
                        if (skill != null) {
                            if (sum >= maxsum) {
                                box.addText("#c00ff00[" + maxsum + "/" + maxsum + "]" + skill.getSkillname(), 235, UIUtils.TEXT_FONT78);
                            } else {
                                box.addText("#c807876[" + sum + "/" + maxsum + "]" + skill.getSkillname(), 235, UIUtils.TEXT_FONT78);
                            }
                        }
                    }
                }
                return;
            } else if (field.startsWith("宝石属性")) {
                box.addText("#c00ffff【宝石镶嵌】", 235, UIUtils.TEXT_FONT78);
                String[] v = field.split("&");
                for (int i = 1; i < v.length; i++) {
                    Goodstable good = GoodsListFromServerUntil.fushis.get(new BigDecimal(v[i]));
                    if (good != null) {
                        box.imageUpdate(daoju.getImage(), 1, 100, 100, 20, 20);
                        StringBuffer buffer = new StringBuffer();
                        buffer.append("#cEA5700");
                        buffer.append(good.getGoodsname());
                        String[] bs = good.getValue().split("\\|");
                        buffer.append(" ");
                        buffer.append(bs[0].split("=")[1]);
                        buffer.append("级 ");
                        bs = bs[1].split("=");
                        buffer.append(bs[0]);
                        buffer.append(" ");
                        buffer.append(zffh(bs[1]) + tianjia(bs[1]));
                        box.addText(buffer.toString(), 235, UIUtils.TEXT_FONT78);
                    }
                }
                return;
            }
        }
        String[] zhi = field.split("=");
        if (zhi[0].equals("装备角色") || zhi[0].equals("等级") ||zhi[0].equals("等级需求") || zhi[0].equals("装备等级") || zhi[0].equals("阶数") || zhi[0].equals("等级要求") || zhi[0].equals("力量要求") || zhi[0].equals("灵性要求") || zhi[0].equals("根骨要求") || zhi[0].equals("敏捷要求") || zhi[0].equals("套装品质")) {
            box.addText("#cFFFFFF【" + zhi[0] + "】" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("装备部位")) {
            String value = AccessSuitMsgUntil.returnPartsName(zhi[1]);
            if (value != null) {zhi[1] = value;}
            box.addText("#cFFFFFF【装备部位】" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("性别要求") || zhi[0].equals("性别")) {
            if (zhi[1].equals("1")) {
                box.addText("#cFFFFFF【性别要求】男", 235, UIUtils.TEXT_FONT78);
            } else if (zhi[1].equals("0")) {
                box.addText("#cFFFFFF【性别要求】女", 235, UIUtils.TEXT_FONT78);
            } else {
                box.addText("#cFFFFFF【性别要求】全部性别", 235, UIUtils.TEXT_FONT78);
            }
        } else if (zhi[0].equals("HP") || zhi[0].equals("MP") || zhi[0].equals("HP%") || zhi[0].equals("MP%") || zhi[0].equals("经验") || zhi[0].equals("亲密") || zhi[0].equals("钱") || zhi[0].equals("点")) {
            box.addText("#cFFFFFF" + zhi[0] + " " + zffh(zhi[1]), 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("力量") || zhi[0].equals("灵性") || zhi[0].equals("根骨") || zhi[0].equals("敏捷")) {
            box.addText("#cCCCC99" + zhi[0] + " " + zffh(zhi[1]), 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("培养") || zhi[0].equals("品质")) {
            box.addText("#c1E90FF" + zhi[0] + " " + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("坐标") || zhi[0].equals("内丹等级")) {
            box.addText("#cFFFF33" + zhi[0] + ":" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("次数")) {
            box.addText("#cFFFF33" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("炼妖次数")) {
            box.addText("#c00BFFF" + zhi[0] + " " + zffh(zhi[1]), 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("描述") || zhi[0].equals("名称")) {
            box.addText("#c00BFFF" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("传送") || zhi[0].equals("宝图")) {
            String[] v = zhi[1].split(",");
            int x = Integer.parseInt(v[2]) / 20;
            int y = Integer.parseInt(v[3]) / 20;
            box.addText("#cFFFF33" + "坐标: " + v[1] + " (" + x + "," + y + ")", 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("可用次数")) {
            box.addText("#cFFFF33" + "还可以使用" + zhi[1] + "次", 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("技能")) {
            box.addText("#cFFFF33" + "技能:#G" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("技能等级")) {
            box.addText("#cFFFF33" + "技能等级:#G" + zhi[1], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("耐久")) {
            box.addText("#cFFFF33" + "耐久:#G" + zhi[1].split(",")[0], 235, UIUtils.TEXT_FONT78);
        } else if (zhi[0].equals("场数")) {
            box.addText("", 235, UIUtils.TEXT_FONT78);
        } else {
            if (zhi.length > 1) {
                if (!zhi[0].equals("召唤兽") && !zhi[0].equals("物品") && !zhi[0].equals("标签") && !zhi[0].equals("值") && !zhi[0].equals("皮肤") && !zhi[0].equals("方向") && !zhi[0].equals("变身卡类") && !zhi[0].equals("lvl") && !zhi[0].equals("刮奖") && !zhi[0].equals("卡类")) {
                    box.addText("#cDEDE9E" + zhi[0] + " " + zffh(zhi[1]) + tianjia(zhi[0]), 235, UIUtils.TEXT_FONT78);
                }
            }
        }
    }

    public int getGwidth() {
        return gwidth;
    }

    public void setGwidth(int gwidth) {
        this.gwidth = gwidth;
    }

    public int getGheight() {
        return gheight;
    }

    public void setGheight(int gheight) {
        this.gheight = gheight;
    }

    public JLabel getLabgoodsimg() {
        return labgoodsimg;
    }

    public void setLabgoodsimg(JLabel labgoodsimg) {
        this.labgoodsimg = labgoodsimg;
    }


    /**
     * 获取装备的套装
     * @param type
     * @return
     */
    public static List<Goodstable> accessIdlEqu(int type) {
        List<Goodstable> listEqui = new ArrayList();
        for(int i = 0; i < GoodsListFromServerUntil.choseGoodsList.length; ++i) {
            if (GoodsListFromServerUntil.choseGoodsList[i] != null) {
                long goodid = GoodsListFromServerUntil.choseGoodsList[i].getGoodsid().longValue();
                long goodtype = GoodsListFromServerUntil.choseGoodsList[i].getType();
                if (Goodtype.EquipmentType(goodtype) != -1 && Goodtype.EquipmentType(goodtype) != 0 && Goodtype.EquipmentType(goodtype) != 4 && Goodtype.EquipmentType(goodtype) != 5 && goodid != 6029L && goodid != 6030L && goodid != 6031L && goodid != 6032L && goodid != 6033L && goodid != 6034L) {
                    if (type == 2) {
                        if (GoodsListFromServerUntil.choseGoodsList[i].getValue().indexOf("套装属性") != -1) {
                            listEqui.add(GoodsListFromServerUntil.choseGoodsList[i]);
                        }
                    } else if (type == 1 && GoodsListFromServerUntil.choseGoodsList[i].getValue().indexOf("套装属性") == -1) {
                        listEqui.add(GoodsListFromServerUntil.choseGoodsList[i]);
                    }
                }
            }
        }
        return listEqui;
    }


    private void timeLockString(Long milliseconds, Graphics g) {


        long between = 0;
        between = milliseconds - System.currentTimeMillis();// 得到两者的毫秒数
        long day = between / (24 * 60 * 60 * 1000);
        long hour = (between / (60 * 60 * 1000) - day * 24);
        long min = ((between / (60 * 1000)) - day * 24 * 60 - hour * 60);
        long s = (between / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
//        long ms = (between - day * 24 * 60 * 60 * 1000 - hour * 60 * 60 * 1000
//                - min * 60 * 1000 - s * 1000);
        g.setColor(Color.red);
        FontMetrics fm = g.getFontMetrics();
        String timeStr = day + "天" + hour + "小时" + min + "分";
        int i =  fm.stringWidth("保护时间  ");
        int i1 = fm.stringWidth(timeStr);
        g.drawString("保护时间", gwidth -i -i1 -20, 20);
        g.setColor(Color.red);
        g.setColor(Color.YELLOW);
        g.drawString(timeStr,gwidth -i1 -20,  20);

    }
    public static double timestampToCircularValue() {
        long timestamp = System.currentTimeMillis(); // 获取当前时间戳（毫秒）
        double timestampSeconds = timestamp / 1000.0; // 转换为秒
        double sinValue = Math.sin(timestampSeconds); // 计算正弦波形值
        double cycleValue = 0.1 + (sinValue + 1.0) / 2.0 * 0.6; // 映射到0.1至0.7之间

        // 输出循环值
        DecimalFormat df = new DecimalFormat("#.00");
        String result = df.format(cycleValue);
        double roundedNum = Double.parseDouble(result);
        return roundedNum;
    }
    public NewPart getPartSH(String skin){
        if(skin!=null) {
            NewPart part=SpriteFactory.createPart(skin, 2, 1, "");
            return part;
        }
        return null;
    }
}